﻿using System.Text;
using System.Threading.Tasks;
using Model.Admin;
using Xproject.Framework.Utility.Extensions;
using Xproject.Framework.Core.Repositories;
using Xproject.Framework.Utility.ExceptionHandling;
using Xproject.Framework.Core;
using System.Linq.Expressions;
using Model.Admin.DTO;
using System;
using System.Linq;
using System.Collections.Generic;

namespace Repository.WXProjectAdmin
{
    public static class AdminUserRoleRep
    {
        public static List<AdminUserRole> GetUserRoles(this IRepositoryAsync<AdminUserRole> repository, int userID)
        {
            Expression<Func<AdminUserRole, bool>> express = i => 1 == 1;

            express = express.AndAlso(i => i.UserID == userID);

            return repository.Query().Where(express).Select().ToList();
        }

    }
}
